package com.my.test.thread.atomic;

public class Atomic {

    private static int count = 0;

    /**
     * 允许一个或多个线程等待其它线程完成操作
     * @param args
     */
    public static void main(String[] args) throws InterruptedException {


        for (int i = 0; i <1000; i++) {
            new Thread (()->{
                ++count;
            }).start();
        }

        Thread.sleep(2000);
        System.out.println(count);

    }




}
